﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Marmat.Forms
{
    /// <summary>
    /// 项目引用的程序集
    /// </summary>
    public static class DesignerReferenceAssembly
    {
        private static List<Assembly> collection;
        /// <summary>
        /// 注册设计时使用的程序集
        /// </summary>
        /// <param name="design"></param>
        /// <param name="assembly"></param>
        public static void Register(this Marmat.Forms.IDesignSupport design, Assembly assembly)
        {
            if (collection is null)
                collection = new List<Assembly>();
            collection.Add(assembly);
        }

        /// <summary>
        /// 获取设计时使用的程序集列表
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<Assembly> GetAssemblyCollection()
        {
            if (collection is null)
                collection = new List<Assembly>();
            return collection.ToArray();
        }
    }
}
